home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DELPHI / LEDIT108.ZIP / LEVBX / LEVBX.TXT < prev    next >
Encoding:
Text File  |  1996-04-26  |  41.1 KB  |  956 lines

  1. LEdit VBX Component - LEVBX.VBX
  2. Copyright (c) 1996 Andrey B. Yastrebov
  3. Distributed by TechnoSoft, Inc.
  4. Documentation file for LEdit VBX (LEdit Shareware Package)
  5.  
  6. Methods
  7. -------
  8.  
  9. You know, VBX can't have custom method. Sometimes they're implemented
  10. with Action propertiy. Here the implementation is slightly different.
  11. Each method is a property of Integer type, that is read-only. To
  12. invoke some method you need only to read this property. The Integer
  13. value you receive indicates the result of the action. Zero means
  14. successful action. Any other value means failure.
  15.  
  16.  
  17. ***** Clear
  18.   This method will clear all the text from LEdit. If this is done, Undo is
  19.   not possible.
  20.  
  21. ***** ClearSelection
  22.   This method will clear all selected text from LEdit.
  23.  
  24. ***** CopyToClipboard
  25.   This method will copy the selected text to the Windows clipboard.
  26.  
  27. ***** CutToClipboard
  28.   This method will clear the selected text and place a copy of it to
  29.   the Windows clipboard.
  30.  
  31. ***** DeleteSelection
  32.   This method will clear all selected text from LEdit. It is identical to
  33.   the ClearSelection property and was created to make it compatible with
  34.   the OWL wrapper. The ClearSelection property was kept to keep
  35.   it compatible with the Delphi VCL wrapper.
  36.  
  37. ***** Duplicate
  38.   This property duplicates the currently selected block. This is equivalent
  39.   to CopyToClipboard followed by PasteFromClipboard, so the clipboard is used.
  40.  
  41. ***** EmptyUndoBuffer
  42.   This method will clear the text from the Undo buffer.
  43.  
  44. ***** Find
  45.   This method will find the next word in a search. It repeats the last search
  46.   performed. It returns 1 if the match was found.
  47.  
  48. ***** FindBookmark
  49.   This method will immediately jump to a bookmark that was set with the
  50.   SetBookmark method.
  51.  
  52. ***** FindBrace
  53.   This method will find a match to the current brace. The OnFindBrace event
  54.   determines what is considered a brace.
  55.  
  56. ***** FindNext
  57.   This method will find the next word in a search. It repeats the last search
  58.   performed.
  59.  
  60. ***** GetSelection
  61.   This method will get the starting and ending character positions of the
  62.   current selection. These positions are reflected in the StartLine, StartPos,
  63.   EndLine, and EndPos properties.
  64.  
  65. ***** GetCurrentWord;
  66.   This method gets the word at the current cursor position. The Syntax property
  67.   determines what is considered a word. The word information is placed into the
  68.   WordText, WordCode and WordValue properties. See their description
  69.   for details.
  70.  
  71. ***** GetScan
  72.   This method retrieves the position of last item received by the scanning
  73.   methods. If last method called NewLine then it returns a pointer to the
  74.   beginning of the line. The position is place into a the StartLine,
  75.   StartPos, EndLine and EndPos properties.
  76.  
  77. ***** GetWord
  78.   This method gets the next word from the current reading position and moves
  79.   the position pointer to the character after this word. The Syntax property
  80.   determines what is considered a word. The word information is placed into the
  81.   WordText, WordCode and WordValue properties. See their description for
  82.   details. SkipLines property determines whether the scanning may cross
  83.   line boundary.
  84.  
  85. ***** LineLength
  86.   This method returns the length of a line. LineNumber property specifies
  87.   which line to return the length of.
  88.  
  89. *** NextLine
  90.   This method moves the reading position used by GetWord to the start of next
  91.   line.
  92.  
  93. ***** PasteFromClipboard
  94.   This method will copy any text existing in the Windows clipboard into LEdit.
  95.  
  96. ***** Redo
  97.   This method will redo the last undone action.  It is the opposite of Undo.
  98.  
  99. ***** ReloadFile
  100.   This method loads the current file into LEdit again. In effect it resets the
  101.   file to the condition it was in the last time it was saved. The HasFile
  102.   property must be set to True to use this method.
  103.  
  104. ***** Replace
  105.   This method compares current selection with SearchFindString and if they
  106.   are the same, then replaces current selection with SearchReplaceString
  107.  
  108. ***** ReplaceAll
  109.   This methods replaces all occurences of SearchFindString with 
  110.   SearchReplaceString.
  111.  
  112. ***** SaveFile
  113.   This method displays a save dialog and allows the user to set a file to
  114.   save the text to within LEdit. It only displays the dialog if a filename
  115.   has not been set. Then it saves the text to this file. If a filename has
  116.   already been set then this method saves the text to that file without
  117.   displaying the dialog. The HasFile property must be set to True to use this
  118.   method.
  119.  
  120. ***** SaveFileAs
  121.   This method is similar to the SaveFile method except it displays the save
  122.   dialog every time it is called. This allows you to save the file with a
  123.   different name. The HasFile property must be set to True to use this method.
  124.  
  125. ***** SaveToFile
  126.   This method saves the text to file. File name should be set into
  127.   FileNameToSave property. This operation doesn't need HasFile property
  128.   to be set to True.
  129.  
  130. ***** SelectAll
  131.   This method sets all the text in LEdit to selected.
  132.  
  133. ***** SetBookmark
  134.   This method sets a bookmark in the LEdit text. The bookmark will be set to
  135.   the current cursor location. When a bookmark is set, the FindBookmark method
  136.   can be used to immediately jump to the bookmark.
  137.  
  138. ***** SetScan
  139.   This method moves the reading pointer to the top of the text and allows the
  140.   GetWord and NextLine methods to operate. Any changes to the text or upon
  141.   reaching the end of the file will disable the ability to use GetWord and
  142.   NextLine. Therefore it is best to set the ReadOnly property to True while
  143.   scanning the text.
  144.  
  145. ***** SetSelection
  146.   This method selects a range of characters. The values set in the StartLine,
  147.   StartPos, EndLine and EndPos properties determine where the selection is
  148.   made.
  149.  
  150. ***** ShowFindDialog
  151.   This method displays a Find dialog to allow you to search for text within
  152.   LEdit.
  153.  
  154. ***** ShowFontDialog
  155.   This method displays a Font dialog to allow you to set the font in
  156.   LEdit.
  157.  
  158. ***** ShowGotoLineDialog
  159.   This method displays a Goto Line dialog to allow you to go to a specific
  160.   line number in LEdit.
  161.  
  162. ***** ShowReplaceDialog;
  163.   This method displays a Replace dialog to allow you to perform a search and
  164.   replace in LEdit.
  165.  
  166. ***** Undo
  167.   This method undoes the last action. It is the opposite of Redo.
  168.  
  169. ================================================================================
  170.  
  171. Runtime only properties
  172. -----------------------
  173.  
  174. ***** BookmarkAttr  TYPE = Integer
  175.   Write only. Changes bookmark attributes. Only bookmark with number set into
  176.   BookmarkNumber property is affected. The following values make sense:
  177.  
  178.   Value   Meaning
  179.   -----------------------
  180.   0       Bookmark won't be coloured
  181.   1       Bookmark text will be coloured with color set via BookmarkForeColor
  182.           Default is Yellow
  183.   2       Bookmark background will be coloured with color set via
  184.           BookmarkBackColor. Default is Red
  185.   3       Both 1 and 2
  186.  
  187. ***** BookmarkBackColor  TYPE = Color
  188.   Specifies background color to be used to highlight bookmark. Only bookmark with
  189.   number specified in BookmarkNumber property is affected.
  190.  
  191. ***** BookmarkForeColor  TYPE = Color
  192.   Specifies text color to be used to highlight bookmark. Only bookmark with
  193.   number specified in BookmarkNumber property is affected.
  194.  
  195. ***** BookmarkLine  TYPE = Long
  196.   Sets or gets number of line that corresponds to the bookmark with number
  197.   BookmarkNumber. Actually it sets or gets bookmark. As user edit text, number
  198.   of line may change, so the number get trought this property may differ from
  199.   the number set.
  200.  
  201. ***** BookmarkNumber  TYPE = Integer (currently 0-15)
  202.   Write only. Used by BookmarkLine, BookmarkAttr, BookmarkBackColor and
  203.   BookmarkForeColor to manage Bookmarks
  204.  
  205. ***** BurnHandle  TYPE = Integer
  206.   Write only. This property allows you to pass a handle and it will free the
  207.   memory associated with that handle. The primary purpose of this property is
  208.   to provide an easy way to free global memory that is you allocate to store
  209.   text in. It is basically a wrapper for the Windows API GlobalFree method.
  210.   When you read the Text or SelText properties, global memory is allocated
  211.   to hold the text. When you are finished using this text, you need to
  212.   call the BurnHandle method and pass it the Handle returned from the Text
  213.   or SelText property. It is very important to call this method before
  214.   your program ends, if you read the Text or SelText property. If you
  215.   don't, your program will develop a memory leak.
  216.  
  217.  
  218. ***** CanClose  TYPE = Boolean
  219.   Read only. This property is set by LEdit and specifies whether the
  220.   application can close or not. It returns True only if all the events allow
  221.   it to close. See LEdit documentation for more details.
  222.  
  223. ***** CanFindNext  TYPE = Boolean
  224.   Read only. This property is set by LEdit and specifies whether the
  225.   search word exists. If the search word exists, then this property will be
  226.   set to True.
  227.  
  228. ***** CanRedo  TYPE = Boolean
  229.   Read only. This property is set by LEdit and specifies whether Redo
  230.   is possible. If it is set to True then Redo is possible.
  231.  
  232. ***** CanUndo  TYPE = Boolean
  233.   Read only. This property is set by LEdit and specifies whether Undo
  234.   is possible. If it is set to True then Undo is possible.
  235.  
  236. ***** EndLine  TYPE = Long
  237.   This property allows the end line to be set. This is used for all methods
  238.   that use the EDITPOSITION record (such as SetSelection and GetSelection).
  239.   See the GetScan property.
  240.  
  241. ***** EndPos  TYPE = Long
  242.   This property allows the end position within the end line to be set. This
  243.   is used for all methods that use the EDITPOSITION record (such as
  244.   SetSelection and GetSelection). See the GetScan property.
  245.  
  246. ***** GetLine  TYPE = String
  247.   This property gets the current line. LineNumber property should contain the
  248.   number of the line to get.
  249.  
  250. ***** GetRestOfLine(Buffer: PChar): Word;
  251.   This property gets the current line from the scanning position to the end
  252.   of the line. See SetScan method for more details.
  253.  
  254. ***** FileNameToSave  TYPE = String
  255.   Write only. Stores file name. Makes sense only as supplier for
  256.   SaveToFile method.
  257.  
  258. ***** FirstVisibleLine  TYPE = Long
  259.   Read only. This property returns the number of the first visible line
  260.   in LEdit.
  261.  
  262. ***** FirstVisiblePos  TYPE = Word
  263.   Read only. This property returns the number of the first visible position
  264.   within a line in LEdit.
  265.  
  266. ***** IsLEdit  TYPE = Boolean
  267.   Read only. This property determines whether the window is a LEdit window.
  268.   Actually always true.
  269.  
  270. ***** LineCount  TYPE = Long
  271.   Read only. This property returns the total number of lines of text in
  272.   LEdit.
  273.  
  274. ***** LineNumber  TYPE = Long
  275.   Write only. Used by GetLine and LineLength properties to indicate
  276.   line number.
  277.  
  278. ***** MenuPopUpHandle  TYPE = Integer
  279.   Read only. This property returns a Handle to the popup menu in LEdit. This
  280.   allows the popup menu to be modified.
  281.  
  282. ***** Modified  TYPE = Boolean
  283.   This property determines if the text in LEdit has been modified. LEdit will
  284.   set it to True if text is modified. When you set this property, it will set
  285.   the modified status of whichever modify flag number is set in the
  286.   ModifyFlagNumber property.
  287.  
  288. ***** ModifyFlagNumber TYPE = 0 - 15
  289.   This property contains the number of the Modified flag currently being used
  290.   by LEdit. It can contain values in the range of 0 to 15. This provides 16
  291.   modified flags that can be used for nearly any purpose. Flags 0 and 1
  292.   have special meaning (see LEdit documentation).
  293.  
  294. ***** SearchDirection  TYPE = 0 - 2
  295.   This property determines search direction.
  296.  
  297.   Value   Meaning
  298.   -----------------------
  299.   0       Search up
  300.   1       Search down
  301.   2       Search down and wrap over the end of the text
  302.  
  303. ***** SearchFindString  TYPE = String
  304.   This is the string used to make searhes and in Find/Replace dialogs
  305.  
  306. ***** SearchMatchCase  TYPE = Boolean
  307.   This property determines whether or not search is case-sensitive
  308.  
  309. ***** SearchReplaceString  TYPE = String
  310.   This is the string used to replace matches found
  311.  
  312. ***** SearchWholeWords  TYPE = String
  313.   This property determines whether search will find whole words or not.
  314.   Word boundaries are determined according to Syntax property.
  315.  
  316. ***** SelLength  TYPE = Long
  317.   Read only. This property returns the number of characters in the selected
  318.   text.
  319.  
  320. ***** SelText  TYPE = Integer
  321.   This property works exactly the same as the Text property described below,
  322.   but works with any selected text instead of all the text. When you read
  323.   this property, it allocates global memory, places a copy of any selected
  324.   text into it, and returns a handle to the memory. This handle must be
  325.   freed when you are finished with it by calling the BurnHandle method and
  326.   passing it this Handle. You can also allocate your own memory and, place
  327.   text into it, and then set this property to the Handle of the memory
  328.   you created. This will replace any selected text in LEdit with your text.
  329.   If no text is selected, then this text will be inserted at the cursor
  330.   location. See the Text property and BurnHandle method for more information.
  331.  
  332. ***** SkipLines  TYPE = Boolean
  333.   Write only. Determines whether to cross line boundaries during execution
  334.   of GetWord method.
  335.  
  336. ***** StartLine  TYPE = Long
  337.   This property allows the start line to be set. This is used for all methods
  338.   that use the LEDITPOSITION record (such as SetSelection and GetSelection).
  339.   See the GetScan property.
  340.  
  341. ***** StartPos: Integer;
  342.   This property allows the start position within the start line to be set.
  343.   This is used for all methods that use the LEDITPOSITION record (such as
  344.   SetSelection and GetSelection). See the GetScan property.
  345.  
  346. ***** Text  TYPE = Integer
  347.   When this property is read, it allocates a block of Global memory and places
  348.   a copy of the text, in the LEdit control, into it. It then returns a Handle
  349.   to the block of memory. When you access this block of memory, you should
  350.   call the Windows API GlobalLock method first. This will return to you a
  351.   pointer to the text which you can use however you wish. It is probably best
  352.   to typecast the pointer to a PChar type when using it so it is type
  353.   compatible with most other text handling methods. When you are finished
  354.   with the text, you need to call the BurnHandle method and pass this handle
  355.   to it. This will free the memory block allocated to the text. See the
  356.   BurnHandle method for details. You can also allocate a block of memory
  357.   youself and place text into it. Then set the Text property to the Handle
  358.   of the block of memory you created. This will place a copy of the text, in
  359.   the block of memory you created, into LEdit.
  360.  
  361.     Example (in VB)
  362.  
  363.     ' To have LEdit allocate a block of memory and place a copy of
  364.     '  the text in LEdit into it
  365.  
  366.     H = LEditVBX1.Text 'Now H contains the handle of memory
  367.  
  368.     ' To place the text in an existing block of memory into LEdit. This
  369.     ' specific example will place the text, from the H above, back
  370.     ' into LEdit.
  371.  
  372.     LEditVBX2.Text = H       'Text is set to LEditVBX2
  373.     LEditVBX1.BurnHandle = H 'Free the memory
  374.                              'LEditVBX2.BurnHandle is equally
  375.                              'appropriate here
  376.  
  377. ***** TextLength  TYPE = Long
  378.   Read only. This property returns the total number of characters in LEdit.
  379.  
  380. ***** UndoMaxBuffer  TYPE = Integer
  381.   Read only. This property returns the maximum size of the undo buffer
  382.   (Undo level) that can be set.
  383.  
  384. ***** UnitsHorizontal  TYPE = XSize
  385.   Read only. This property returns the horizontal (maximum character width)
  386.   scrolling units in twips.
  387.  
  388. ***** UnitsVertical  TYPE = YSize
  389.   Read only. This property returns the vertical (line height) scrolling units
  390.   in twips.
  391.  
  392. ***** WordCode  TYPE = Integer
  393.   Read only. This property provides an interface to a WORDDESC structure.
  394.   This property is used in all methods and properties that use a WORDDESC
  395.   structure. See the GetCurrentWord and GetWord properties. It corresponds
  396.   to the wCode field of WORDDESC structure (see LEdit documentation)
  397.  
  398. ***** WordText  TYPE = String
  399.   Read only. This property provides an interface to a WORDDESC structure.
  400.   This property is used in all methods and properties that use a WORDDESC
  401.   structure. See the GetCurrentWord and GetWord properties. It corresponds
  402.   to the caWord field of WORDDESC structure (see LEdit documentation)
  403.  
  404. ***** WordValue  TYPE = Long
  405.   Read only. This property provides an interface to a WORDDESC structure.
  406.   This property is used in all methods and properties that use a WORDDESC
  407.   structure. See the GetCurrentWord and GetWord properties. It corresponds
  408.   to the dwValue field of WORDDESC structure (see LEdit documentation)
  409.  
  410. ================================================================================
  411.  
  412. Design-time properties
  413. ----------------------------------
  414.  
  415. ***** About  TYPE = UserDefined
  416.   Design only. This property displays an about box for the LEdit component.
  417.  
  418. ***** AutoIndent  TYPE = Boolean
  419.   This property turns on and off auto-indent. If it is set to True then
  420.   auto-indent is turned on. The default is False.
  421.  
  422. ***** BackColor  TYPE = Color
  423.   This property sets the background color of text within LEdit.
  424.  
  425. ***** BackColorSelected  TYPE = Color
  426.   This property sets the background color of selected text within LEdit.
  427.  
  428. ***** BorderStyle  TYPE = 0 - 1
  429.   This property sets the style of the border around the LEdit component.
  430.   The default is 0.
  431.  
  432.   These are the possible values:
  433.  
  434.   Value       Meaning
  435.   ------------------------------------------
  436.   0           No visible border
  437.   1           Single-line border
  438.  
  439. ***** CanChangeFile  TYPE = Boolean
  440.   This property determines if the LEdit internal popup menu
  441.   contains items that allow the user to open a new or existing file.
  442.   If it is set to True then the popup menu will contain items to open
  443.   a new or existing file. The HasFile property must be set to True.
  444.   The default is False.
  445.  
  446. ***** CanChangeFont  TYPE = Boolean
  447.   This property determines if the LEdit internal popup menu
  448.   contains items that allow the user to change the font. If it is set to
  449.   True then the popup menu will contain items to change the font.
  450.   The default is False.
  451.  
  452. ***** CurrentWordAsText  TYPE = Boolean
  453.   When set, all operations retrieving word from cursor position will receive
  454.   word delimited with spaces, tab chars and line breaks. Otherwise the meaning
  455.   of the word is determined by current syntax. The default is False.
  456.  
  457. ***** DefaultSelection  TYPE = Boolean
  458.   This property determines the behavior when a character key or the delete
  459.   or backspace key is pressed and LEdit contains selected text. If
  460.   DefaultSelection is set to True then it forces the selected text to be
  461.   removed when a character key, the Delete key or the BackSpace key is
  462.   pressed. This is the default Windows behaviuor. If DefaultSelection is
  463.   set to False then only the last selected character is replaced or deleted
  464.   when a character key, the Delete key or the BackSpace key is pressed.
  465.   The default is False.
  466.  
  467. ***** ExtraHorzSpacing  TYPE = 0 - 3
  468.   This property allows extra horizontal spacing to be set in
  469.   LEdit. Sometimes it is difficult to see the cursor when it is right against
  470.   the edge of the component. This allows you to set that edge to be indented
  471.   a particular number of pixels. The default is 1.
  472.  
  473.   These are the possible values:
  474.  
  475.   Value          Meaning
  476.   ----------------------------------
  477.   0 - None       Not indented
  478.   1 - Small      Indented 2 pixels
  479.   2 - Medium     Indented 4 pixels
  480.   3 - Large      Indented 6 pixels
  481.  
  482. ***** ExtraVertSpacing  TYPE = 0 - 3
  483.   This property allows extra vertical spacing to be set in LEdit. This is the
  484.   amount of space between lines. The purpose of this is to allow better
  485.   readability of some fonts. The default is 0.
  486.  
  487.   These are the possible values:
  488.  
  489.   Value          Meaning
  490.   ----------------------------------
  491.   0 - None       Not indented
  492.   1 - Small      Indented 2 pixels
  493.   2 - Medium     Indented 4 pixels
  494.   3 - Large      Indented 6 pixels
  495.  
  496. ***** FileMask  TYPE = String
  497.   This property allows you to set the mask for the Open dialog. It can accept
  498.   the mask only as the LEdit DLL requires. See the LEdit documentation for
  499.   details.
  500.  
  501. ***** FileName  TYPE = String
  502.   This property allows the filename to be set for any file operations
  503.   performed in LEdit. This property contains some special behaviors.
  504.   While it is set, then file name may have special meaning:
  505.  
  506.     Empty string - LEdit should be cleared
  507.     "+" - Open dialog should be shown that allow user to
  508.           chose file. Unlike bare LEdit, if user click "Cancel"
  509.           in this dialog, LEdit becomes cleared as if empty
  510.           string was passed.
  511.  
  512. ***** Font  TYPE = Font
  513.   This property allows you to set the font and the font attributes
  514.   in LEdit. Actually it is much container-specific.
  515.  
  516. ***** ForeColor  TYPE = Color
  517.   This property sets the foreground color of text within LEdit.
  518.  
  519. ***** ForeColorSelected  TYPE = Color
  520.   This property sets the foreground color of selected text within LEdit.
  521.  
  522. ***** GroupNumber  TYPE = Integer
  523.   Design only. Specifies number of group. Should be set to 0 if groups aren't
  524.   used. If it isn't zero then all controls with the same GroupNumber are united
  525.   in single group and share some attributes - currently Find/Replace dialogs
  526.   and Insert/Overtype status. The default is 0.
  527.  
  528. ***** HasFile  TYPE = Boolean
  529.   This property determines whether LEdit stores file information
  530.   internally or not. If it is set to True then LEdit automatically handles
  531.   files. That is, it stores the filename, it can automatically load and save
  532.   files and it checks whether the user saved the files or not. See the LEdit
  533.   documentation for details. The default is False.
  534.  
  535. ***** HasMenu  TYPE = 0 - 1
  536.   This property allows the popup menu to be set. LEdit contains its own
  537.   internal popup menu. The default is 0.
  538.  
  539.   These are the possible values:
  540.  
  541.   Value          Meaning
  542.   ----------------------------------
  543.   0 - None       No popup menu
  544.   1 - PopUp      LEdit popup menu
  545.  
  546. ***** Highlight  TYPE = Boolean
  547.   This property causes the control to begin firing the
  548.   ControlHighlight event. This allows it to determine which colors to use
  549.   when drawing each word. The default is False.
  550.  
  551. ***** InitializeType  TYPE = 0 - 1
  552.   Design only. This property determines the way LEdit is initialized. It can
  553.   be initialized with a File or any custom way you desire. If this is set
  554.   to 1 - File, then the Filename property determines which file is loaded.
  555.   See the FileName property for details. If 0 - Custom is set, then the
  556.   TimeToLoadText event is fired upon startup to allow you to initialize
  557.   it any way you wish. See TimeToLoadText event for details.
  558.   The default is Custom.
  559.  
  560.   These are the possible values:
  561.  
  562.   Value          Meaning
  563.   -------------------------------------------------------
  564.   0 - Custom     Initialize in a custom designed manner
  565.   1 - File       Initialize with a file
  566.  
  567. ***** InsertMode  TYPE = Boolean
  568.   This property turns on or off Insert mode in LEdit. If it is set to True
  569.   then Insert mode is turned on. If it is set to False then Insert mode is
  570.   turned off and Overwrite mode is turned on. The default is True.
  571.  
  572. ***** MacStyleSave  TYPE = Boolean
  573.   If True LEdit uses CR as line breaks when it saves files. Otherwise it
  574.   uses CR-LF pairs. The default is False.
  575.  
  576. ***** MultilineItems  TYPE = Boolean
  577.   True setting allow multiline comments and strings, otherwise they are
  578.   recognized only when single-line. True setting slightly slows down editing
  579.   speed. The default is False.
  580.  
  581. ***** OwnerTag  TYPE = Long
  582.   Reserved.
  583.  
  584. ***** PaintMode  TYPE = 0 - 2
  585.   This property is used to set the mode for painting on the background of
  586.   LEdit. This allows custom backgrounds to be placed behind the text.
  587.   The default is 0. See the Paint event for more details.
  588.  
  589.   These are the possible values:
  590.  
  591.   Value            Meaning
  592.   -----------------------------------------------------------
  593.   0 - None         LEdit paints its own background (Standard)
  594.   1 - Direct       Allows you to paint directly to the LEdit
  595.                    background.
  596.   2 - UseMemoryDC  Allows you to paint to a bitmap in memory
  597.                    and pass this memory bitmap to LEdit. LEdit
  598.                    will then place the text over this bitmap.
  599.  
  600. ***** ReadOnly  TYPE = Boolean
  601.   The ReadOnly property determines if the user can change the contents of
  602.   the control. If ReadOnly is True, the user can't change the contents. If
  603.   ReadOnly is False, the user can modify the contents. The default is False.
  604.  
  605. ***** ScrollBars  TYPE = 0 - 3
  606.   This property allows you to turn on and off scroll bars
  607.   on LEdit. The default is 0.
  608.  
  609.   These are the possible values:
  610.  
  611.   Value            Meaning
  612.   ---------------------------------------------------------
  613.   0 - None         No scroll bars are placed on LEdit
  614.   1 - Horizontal   A horizontal scroll bar is placed on LEdit
  615.   2 - Vertical     A vertical scroll bar is placed on LEdit
  616.   3 - Both         Both vertical and horizontal scroll bars
  617.                    are placed on LEdit
  618.  
  619. ***** StartInComments  TYPE = Boolean
  620.   If True LEdit is forced to think that this is open comment sign before
  621.   the text. It makes sense only if MultilineItems property is set to TRUE.
  622.  
  623. ***** Syntax  TYPE = String
  624.   This property allows you to set the syntax that defines what a word is to
  625.   LEdit. This can be used for many of the methods and properties in the LEdit
  626.   component. This is the property that allows you to customize the behavior of
  627.   the syntax analyzer for syntax color highlighting. The following explains how
  628.   the syntax string must be set up.
  629.  
  630.   The syntax string is composed of several fields between 1 and 3 bytes each.
  631.   Spaces, tabs and line breaks are considered natural delimiters. The problem
  632.   with this, though, is that some expressions may be considered one word when
  633.   they are in fact more than one word. For example, take the expression
  634.   "wordA:=(wordB);". Using the natural delimiters, this would be considered
  635.   as one word, when it is in fact more than one word. In this case, we would
  636.   want the syntax analyzer to consider ':', '=', '(', and ')' as delimeters
  637.   also. Given this, we actually have what we would consider three words:
  638.   'wordA', 'wordB' and ';'. It is extremely important to consider what is a
  639.   word and what is a delimiter. For example, the expression '(wordA = wordB);'
  640.   is quite different than the above expression and would be defined differently.
  641.   We want the above expression to be evaluated as if it were defined as
  642.   "wordA : = ( wordB ) ;" using natural delimiters.
  643.  
  644.   The syntax property simply enumerates such words/delimiters like ':' or '('.
  645.   If ':' is included in the syntax then 'wordA:' actually represents two words,
  646.   'wordA' and ':'. If it is not included in the syntax, then it would be
  647.   considered one word as 'wordA:'. This could be useful in mailers where we
  648.   would want words such as 'Subject:' or 'From:' to be considered as one word.
  649.  
  650.   In Pascal, we have the delimiters ':' and '=', but also have ':=' which needs
  651.   to be considered as a two character word consisting of the delimiters ':' and
  652.   '='. So we must tell LEdit that ':=' is a separate word. In this case, the
  653.   expression above would be split into 'wordA', ':=', '(', 'wordB', ')', and
  654.   ';'. That is exactly what we need for Pascal syntax. So we end up with a list
  655.   of syntax words ':', '=', '(', ')', and ':='. Each of them will be placed
  656.   into one TSyntax structure. To have many of these, we will need an array of
  657.   TSyntax structures. This is basically what the Syntax property provides. A
  658.   combination of characters in the string will be used to fill an array of
  659.   TSyntax structures. The string will need to be filled in the following manner.
  660.  
  661.   A value of 0 causes the syntax to be reset to the default.
  662.   A value of 1 means that the next single character will be considered as a
  663.     word or delimiter.
  664.   A value of 2 means that the next two characters will be considered as a word.
  665.  
  666.   So to create the structure for our example above, we would make the string as
  667.   '1:1=1(1)2:='. This signifies one character of ':', one character of '=', one
  668.   character of '(', one character of ')' and two characters of ':='.
  669.  
  670.   In our Pascal example, we would also need to strip out comments. For example,
  671.   'wordA{this is the first word} := (wordB){this is the second};' should be
  672.   considered the same as our above example. The comments need to be omitted.
  673.   To handle this, the first five fields in the Syntax string have a special
  674.   meaning as follows:
  675.  
  676.   Field   Meaning
  677.   -----   ----------------------------------------------------------------------
  678.     1     Quote character. In Pascal this would be '. A second character also
  679.           needs to be defined in this field as a magic character that represents
  680.           a quote inside a string. In Pascal, this is also a single quote as '.
  681.           So, if we are defining the string for Pascal, this field would consist
  682.           of two quotes and would be defined as 2''.
  683.     2     Alternative Quote character. This is the same as field 1 and defines
  684.           an alternative quote character.
  685.     3     Comment character. This defines a comment character. But it is
  686.           different than field 4 below. This comment character defines a
  687.           character where all text following it is considered a comment and is
  688.           skipped. Any text following this character within the same line cannot
  689.           be highlighted. This could be used for the C comment character '//'.
  690.           If we are defining a string for C, this field would consist of '//'
  691.           and would be defined as 2//.
  692.     4     Starting (or Left) Comment Sign. This is the opening comment
  693.           character. All text following this character up to the Ending Comment
  694.           Sign character (field 5) is regarded as a comment and is skipped. It
  695.           cannot be highlighted. So if we are defining the string for Pascal,
  696.           this field would consist of { and would be defined as 1{.
  697.     5     Ending (or Right) Comment Sign. This is the closing comment
  698.           character. All text after the Starting Comment Sign (field 4) and
  699.           before this character is considered a comment and cannot be
  700.           highlighted. In our Pascal example, this field would consist of } and
  701.           would be defined as 1}.
  702.  
  703.   These five fields must be the first five fields defined in the string. If you
  704.   do not wish to define any of these five fields, then the value in that
  705.   position must contain the value 0 (zero).
  706.  
  707.   So the complete Syntax string for our Pascal example would be defined as
  708.   2''001{1}1:1=1(1)2:=  This would define ' as the quote character, no
  709.   alternative quote character, no comment character, { as the starting comment
  710.   sign, } as the ending comment sign, and :, =, (, ) and := as word delimiters.
  711.  
  712.   The Syntax for C++ would be defined as 2"\2'\2//2/*2*/1:1=1(1)2:= to signify
  713.   "\ as the quote character, '\ as the alternate quote character, // as the
  714.   comment character, /* as the starting comment sign, */ as the ending comment
  715.   sign, and :, =, (, ) and := as word delimiters.
  716.  
  717.   Examples above surely don't show full syntax needed to Pascal or C++, only
  718.   a small part of ...
  719.  
  720.   In some cases, the meaning of the delimiter can change depending upon where
  721.   it lies in the word. For example, the word 'teleport.com' should not be
  722.   treated as two separate words. We would want 'teleport.com' or '1.50' to be
  723.   considered as one word, while 'end.' would be considered two words, 'end'
  724.   and '.'. The period will be defined as a soft delimiter instead of a hard
  725.   delimiter. To do this, you need to include '2. ' (two, point, space) in the
  726.   Syntax string. To define the period as a hard delimiter, you would define it
  727.   as '1.' (one, point).
  728.  
  729.   The maximum number of syntax items is 254 characters. See the EM_SETSYNTAX
  730.   message in the LEdit documentation for more information. Keep in mind that
  731.   the component is a string value and the LEdit documentation describes the
  732.   syntax as a string. This string is actually parsed and sent to the LEdit
  733.   DLL in the format described in the LEdit documentation.
  734.  
  735. ***** TabStop  TYPE = Boolean
  736.   Design only. The TabStop property determines if the user can tab to a
  737.   control. If TabStop is True, the control is in the tab order. If TabStop
  738.   is False, the control is not in the tab order; therefore, the user can't
  739.   press the Tab key to move to the control. If it is true, pressing Tab key
  740.   while LEdit has focus will move focus to the next control. Otherwise,
  741.   tab character is inserted into the editing text. The default is True.
  742.  
  743. ***** TabStopSize  TYPE = 1 - 40
  744.   This property allows you to set the size of tab stops in character units.
  745.   It can be within the range of 1 to 40. The default is 1.
  746.  
  747. ***** UnixStyleSave  TYPE = Boolean
  748.   If True LEdit uses LF as line breaks when it saves files. Otherwise it
  749.   uses CR-LF pairs. The default is False.
  750.  
  751. ***** UndoDepth  TYPE = Integer
  752.   This property allows you to set the number of Undo levels within LEdit.
  753.   This is the number of actions that can be undone. Each time the Undo
  754.   method is called, it will undo the next action in the list of undo
  755.   actions. If this property is set to -1 then it sets the undo depth to
  756.   the maximum number of undo buffers allowed, as determined by the
  757.   UndoMaxBuffer property. See the UndoMaxBuffer runtime property.
  758.   The default is -1.
  759.  
  760. ***** Version  TYPE = Integer
  761.   This property returns the version number of the LEdit DLL.
  762.  
  763. ================================================================================
  764.  
  765. Events
  766. ------
  767.  
  768. ***** AskIfStoreFile (Response As Integer)
  769.   This event is fired when an unsaved file is about to be closed. It is
  770.   always preceded by the GoingToClose event.
  771.  
  772. ***** Change
  773.   This event is fired not only when the text is changed but also when
  774.   the caret position is changed. This is done to faciliate status line
  775.   management if you want to track the position of the caret.
  776.  
  777. ***** ChangeMode
  778.   This event is fired when the Insert/Overwrite mode is changed.
  779.  
  780. ***** ClipboardError
  781.   This event is fired when a Clipboard error occurs during an attempt to
  782.   place or read text to or from the clipboard.
  783.  
  784. ***** ControlHighlight (WordCode As Integer,
  785.                         WordValue As Long,
  786.                         WordText As String,
  787.                         BkColor As Long,
  788.                         TextColor As Long
  789.                         Response As Integer)
  790.   This event is fired when the Highlight property is set to True. LEdit
  791.   fires this event for each word in the control. This allows the color of
  792.   each word to be set to allow highlighting.
  793.  
  794.   The following values are passed to this event:
  795.  
  796.   Read Only
  797.   ---------
  798.   WordCode           - This contains the type of the Word. See the LEdit
  799.                        documentation for details.
  800.   WordValue          - This contains the numeric value of the word as
  801.                        defined by the WordCode variable.
  802.   WordText           - This contains the string value of the current word.
  803.  
  804.   Write Only
  805.   ----------
  806.   TextColor       - This variable should be set to whatever foreground
  807.                     color you want the particular word returned in the
  808.                     WordCode, WordValue and WordText variables.
  809.   BkColor         - This is the same as the TextColor but is used to set the
  810.                     background color of the word.
  811.  
  812.   Response        - 0 - Don't highlight the word
  813.                   - 1 - Use only BkColor
  814.                   - 2 - Use only TextColor
  815.                   - 3 - Use both colors
  816.  
  817. ***** FileError
  818.   This event is fired when an error occurs during any file operations that
  819.   LEdit performs.
  820.  
  821. ***** FindBrace (WordCode As Integer,
  822.                  WordValue As Long,
  823.                  WordText As String,
  824.                  Response As Integer)
  825.   This event is fired when LEdit tries to determine where a brace is
  826.   for syntax highlighting. The application should not change the text
  827.   in LEdit from within this event. In the case where words are
  828.   considered braces (eg., "begin", "end"), you need to tell LEdit if it
  829.   has an opposite brace or not and if it does, what the opposite brace
  830.   is. To do this, you place the opposite brace into caWord of the
  831.   WordDesc property. See the LEdit example 'ledit_4' to see how this
  832.   is done.
  833.  
  834.   The following values are passed to this event:
  835.  
  836.   Read and Write
  837.   --------------
  838.   WordCode           - This contains the type of the Word. See LEdit
  839.                        documentation.
  840.   WordValue          - This contains the numeric value of the word as
  841.                        defined by the WordCode variable.
  842.   WordText           - This contains the current word.
  843.  
  844.   Write Only
  845.   ----------
  846.   Response     - You need to set this variable with the type of
  847.                  brace the word is. Other fields must be filled
  848.                  in with word supposed to be brace of that word
  849.  
  850.   Response should be set to one of the following to specify what type of
  851.   brace the word is:
  852.  
  853.   Response should be set to one of the following to specify that the
  854.   brace has an opposite brace of this type:
  855.  
  856.   Value                 Meaning
  857.   -------------------------------------------------
  858.   0                   The word has no opposite brace.
  859.   1                   The word has a left brace.
  860.   2                   The word has a right brace.
  861.   5                   The word has a left brace
  862.                         (case insensitive search).
  863.   6                   The word has a right brace
  864.                         (case insensitive search).
  865.  
  866. ***** GoingToClose
  867.   This event is fired when LEdit is ready to close. If the file in the
  868.   control was not saved, this will be followed by an AskIfStoreFile
  869.   event. This event is fired when LEdit is ready to close. It is also
  870.   fired any time a new file is started or opened.
  871.  
  872. ***** GotFocus
  873.   This event is fired when the LEdit component receives focus.
  874.  
  875. ***** HorzScroll
  876.   This event is fired when LEdit is scrolled horizontally.
  877.  
  878. ***** LostFocus
  879.   This event is fired when the LEdit component loses focus.
  880.  
  881. ***** MaxLine
  882.   This event is fired when a user action generates a string greater
  883.   than 8K (current limitation per line). If a string longer than 8K
  884.   is loaded from a file or inserted from the clipboard, this event is
  885.   not fired. Instead, the string is automatically split without
  886.   notification.
  887.  
  888. ***** NewFile
  889.   This event is fired when LEdit creates a new file.
  890.  
  891. ***** NewFont
  892.   This event is fired when the font is changed.
  893.  
  894. ***** Paint (DC As Integer)
  895.   This event is fired when the PaintMode property is set to Direct or
  896.   UseMemoryDC and LEdit is ready to paint the background. This allows
  897.   you to draw a special background.
  898.  
  899.   The following values are passed to this event:
  900.  
  901.   Read Only
  902.   ---------
  903.   DC        - This contains the Handle to the device context that can
  904.               be drawn on. If the PaintMode property is set to
  905.               Direct, then this will contain the handle to the device
  906.               context that allows you to draw directly on the LEdit
  907.               background. If the PaintMode property is set to
  908.               UseMemoryDC then this will contain a handle to a
  909.               memory device context that can be drawn on. This memory
  910.               device context is then passed to LEdit. LEdit will then
  911.               draw the text on this memory device context before it
  912.               displays it. This allows flicker free drawing of the
  913.               background, at the expense of speed.
  914.  
  915. ***** SpaceError
  916.   This event is fired when a memory error occurs.
  917.  
  918. ***** TimeToLoadText
  919.   This event is fired at initialization, when the Initialize property is
  920.   set to Custom. This is to allow you to customize the way LEdit is
  921.   initialized. See the Initialize property for details.
  922.  
  923. ***** VertScroll
  924.   This event is fired when LEdit is scrolled vertically.
  925.  
  926. ***** WordClick (WordCode As Integer,
  927.                  WordValue As Long,
  928.                  WordText As String,
  929.                  Response As Integer)
  930.   This event is fired when a word is double clicked in LEdit.
  931.  
  932.   The following values are passed to this event:
  933.  
  934.   Read Only
  935.   ---------
  936.   WordCode     - This contains the type of the Word. See LEdit
  937.                  documentation.
  938.   WordValue    - This contains the numeric value of the word as
  939.                  defined by the WordCode variable.
  940.   WordText     - This contains the current word.
  941.  
  942.   Write Only
  943.   --------------
  944.   Response  - This contains the status on whether this word
  945.               was handled in this event. If it is not handled
  946.               in this event, then you need to set this variable
  947.               to 0. This is the default and LEdit will
  948.               highlight the word clicked by default. If you
  949.               handle the word in this event, then you need to
  950.               set this variable to 1. This way LEdit will
  951.               not handle it. This can be used for spell checking
  952.               and other uses where you need to handle a word
  953.               that is double clicked on.
  954.  
  955. ================================================================================
  956.